<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'role_list.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<!-- JQuery 引入 -->
<script type="text/javascript" src="bootstrap-rs/jquery.min.js"></script>
</head>

<body>
	<form class="form-inline definewidth m20" action="sys/role/queryByName"
		id="pager" method="post">
		角色名 :<input type="text" name="vRolename" class="abc input-default"
			 value="${vRolename }">&nbsp;&nbsp;


		<button type="submit" class="btn btn-primary">查询</button>
		&nbsp;&nbsp;
		<button type="button" class="btn btn-success" id="addnew">新增角色</button>
	</form>
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th>角色名称</th>
				<th>操作</th>
			</tr>
		</thead>
		<c:forEach items="${roles }" var = "role">
			<tr>
				<td>${role.vRolename }</td>
				<td>
					<a href="sys/role/queryById?id=${role.nRoleid  }">查看</a> 
					<a href="sys/role/updateData?id=${role.nRoleid  }">修改</a> 
					<a href="sys/role/delete?id=${role.nRoleid }">删除</a> 
			</tr>
		</c:forEach>

	</table>

</body>
</html>
<script>
	$(function() {
		$('#addnew').click(function() {
			window.location.href = "sys/role/addData";
		});
	});

	function del(id) {
		if (confirm("确定要删除吗？")) {
			var url = "index.html";
			window.location.href = url;
		}
	}
</script>
